package cn.spike.rockcc.mq.consumer;

import cn.spike.rockcc.service.IPayOrderService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author:spike
 * @create:2023-03-24 10:42
 */
@RocketMQMessageListener(
        consumerGroup = "service-consumer-pay",
        topic = "orderCancel-topic",
        selectorExpression = "orderCancel-tags"
)
public class OrderCancelConsumer implements RocketMQListener<String> {

    @Autowired
    private IPayOrderService payOrderService;

    @Override
    public void onMessage(String orderNo) {
        payOrderService.cancelOrder(orderNo);
    }
}
